﻿using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using System.Data.Entity;
using System.Collections.Generic;

namespace Backend.Data.Entities
{
    public class ApplicationUser : IdentityUser
    {
        public virtual bool IsPasswordChangeRequired { get; set; }

        public virtual NaturalPerson NaturalPerson { get; set; }

        public virtual ICollection<GeoReferencia> GeoReferencias { get; set; } // 0.* to 0.*


        public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager, string authenticationType)
        {
            // Tenga en cuenta que el valor de authenticationType debe coincidir con el definido en CookieAuthenticationOptions.AuthenticationType
            var userIdentity = await manager.CreateIdentityAsync(this, authenticationType);
            // Agregar reclamaciones de usuario personalizado aquí
            return userIdentity;
        }
    }
}
